<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %>
<%@ taglib prefix="fns" uri="/WEB-INF/tlds/fns.tld" %>
<div class="navbar navbar-default navbar-fixed-top pc_width">
		<nav class="container navbar navbar-default navbar-fixed-top pc_width">
			<c:if test="${type!=null}">
			<div style="position: absolute; top:10; left: 20; font-size: 14px; z-index: 100px; height: 20px; line-height: 20px;vertical-align: middle;">
				<a href="${pageContext.request.contextPath}${fns:getFrontPath()}" style="color: white;" id="indexPage">首页</a>
			</div>
			</c:if>
			<div class="container-fluid text-center" style="font-size: 16px; color: white;">
				<strong>乐活社区</strong>
			</div>
			<c:if test="${type==null}">
			<div style="position: absolute; top:10; right: 20; font-size: 14px; z-index: 100px; height: 20px; line-height: 20px;vertical-align: middle;">
				<a href="${ctxShop}/shoping/toLogin" style="color: white;" id="notLogin">登录</a>
				<a href="javascript:" style="color: white; display: none;" id="logined">我的订单</a>
			</div>	
			</c:if>
		</nav>
	</div>
<script>
/**
 * 初始化用户信息
 */
function initUser(){
	var cookieService = new  MallCookieService();
	var userId = cookieService.getUserId();
	//var userName = cookieService.getUserName();
	//var mobile = cookieService.getMobile();
	if(userId!=null && userId!=""){
		//已登录
		$("#notLogin").hide();
		$("#logined").attr("href","${ctxShop}/shoping/myOrder/orderList?type=1&userId="+userId);
		$("#logined").show();
	}else{
		if(window.location.href.indexOf("toLogin")>=0){
			$("#notLogin").hide();
			$("#logined").hide();
		}else{
			$("#notLogin").show();
			$("#logined").hide();
		}
	}
}
initUser();
</script>